function [Hist,Node]=DistApp_DiscretizeDist(DistFlag,Breaks,varargin)
if size(Breaks,1)==1 || size(Breaks,2)==1
    Breaks  =   reshape(Breaks,[length(Breaks),1]);
else
    error('Breaks is not a vector!\n');
end
switch DistFlag
    case 'Normal'
        MU  =   varargin{1};
        N   =   length(MU);
        MU  =   reshape(MU,[N,1]);
        SIG =   reshape(varargin{2},[N,1]);
        SIG =   max(SIG,eps);
        
        xx  =   bsxfun(@minus,Breaks,MU');
        xx  =   bsxfun(@rdivide,xx,SIG');
        
        CDF =   normcdf(xx);
        
        Hist=   [CDF(1,:);diff(CDF);1-CDF(end,:)];
        Node=   [Breaks(1);(Breaks(2:end)+Breaks(1:end-1))/2;Breaks(end)];
end
end